#pragma once
#include "brtree.hpp"

/**
 * 
 * map v1.0.0
 * @author nhy
 * 
*/


namespace nhydata
{

template<class Key,class T>
class map
{
    using value_type = std::pair<const Key,T>;
    struct MapKeyOfT{
        const Key& operator()(const value_type& value){
            return value.first;
        }
    };
public:
    bool insert(const value_type& value){
        return rb_tree.insert(value).second;
    }
private:
    RBTree<Key,value_type,MapKeyOfT> rb_tree;

};


void test_map()
{
    nhydata::map<int,int> s;
    s.insert(std::make_pair(1,2));
    s.insert(std::make_pair(4,2));
    s.insert(std::make_pair(5,2));
    s.insert(std::make_pair(9,2));
}


}//namespace nhydata end
